
import { useAxios } from '@hang/utils'
const test = ['test', 'development']
const MODE = import.meta.env.MODE
const sign = test.includes(MODE) ? 'test' : ''
const { instance, Http: http } = useAxios({
  baseURL: import.meta.env.VITE_APP_API_URL,
  config: {
    headers: {
      sign,
      'Content-Type': 'application/json;charset=UTF-8',
    },
  },
  onErrorCode: (code, data) => {
    ElMessageBox({
      title: '提示',
      message: '您的会话已过期，请重新登录',
      type: 'info',
    }).then(() => {
    })
  },
})
export default instance
export { http }
